﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace QuanLiHocSinh
{
    public partial class Menu : Form
    {
        public Menu()
        {
            InitializeComponent();
        }

        private void button9_Click(object sender, EventArgs e)
        {
            
            if (MessageBox.Show("Bạn có chắc chắn muốn thoát chương trình", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                this.Close();
            }
        }

        private void button5_Click(object sender, EventArgs e)
        {
            QuiDinh f5 = new QuiDinh();
            f5.Activate();
            f5.ShowDialog(this);
           
        }

        private void button1_Click(object sender, EventArgs e)
        {
            TiepNhanHocSinh tnhs = new TiepNhanHocSinh();
            
            tnhs.Activate();
            
            tnhs.ShowDialog(this);
        }

        private void button8_Click(object sender, EventArgs e)
        {
            ThemMonHoc tmh = new ThemMonHoc();
            tmh.Activate();
            tmh.ShowDialog(this);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có chắc chắn muốn đăng xuất", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {

                MessageBox.Show("Bạn đã đăng xuất", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                this.Close();

                Thread thread_open = new Thread(new ThreadStart(restart));
                thread_open.Start();

                
            }

        }

        static void restart()
        {
            Application.Run(new DangNhap());
        }

        private void button2_Click(object sender, EventArgs e)
        {
            LapDanhSachLop dsl = new LapDanhSachLop();
            dsl.Activate();
            dsl.ShowDialog(this);



            
        }

        private void button3_Click(object sender, EventArgs e)
        {
            TraCuu tc = new TraCuu();
            tc.Activate();
            tc.ShowDialog(this);
        }

        private void button7_Click(object sender, EventArgs e)
        {
            NhapDiem nd = new NhapDiem();
            nd.Activate();
            nd.ShowDialog(this);
        }

        private void button6_Click(object sender, EventArgs e)
        {
            TongKet tk = new TongKet();
            tk.Activate();
            tk.ShowDialog(this);
            
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Nhom n = new Nhom();
            n.Activate();
            n.ShowDialog();
        }
    }
}
